import { RequestConfig } from "@umijs/max";
import { message } from "antd";
const request: RequestConfig = {
    timeout: 5000,
    baseURL:'/api',
    // other axios options you want
    errorConfig: {
      errorHandler(){
      },
      errorThrower(){
      }
    },
    requestInterceptors: [],
    responseInterceptors: [
      [(response:any)=>{
        const {data} = response
        if(!data.success){
          message.error(data.message)
        }
        return response
      }
        ,(error:any)=>{
        message.error('数据请求异常')
        throw error}]
    ]
  };
  export default request